//
// Created by Jisam on 2024/8/9 19:06.
// solve P1605 迷宫

//2024-08-09 19:48:36 AC

#include <bits/stdc++.h>

#define PSI pair<string,int>
#define PII pair<int,int>
#define PDI pair<double,int>
#define PDD pair<double,double>
#define VVI vector<vector<int>>
#define VI vector<int>
#define VS vector<string>

#define PQLI priority_queue<int, vector<int>, less<int>>
#define PQGI priority_queue<int, vector<int>, greater<int>>
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;

using namespace std;
int dx[] = {-1,1,0,0,};
int dy[] = {0,0,-1,1,};
int n ,m,t,sx,sy,ex,ey;
i64 ans = 0;
void dfs(int x,int y,vector<PII> cur,vector<vector<int>> & a,vector<vector<int>> &vis){
    if(x == ex && y == ey){
        ans ++;
//        for(auto [xx,yy] : cur)
//        {
//            cout << xx << " " << yy << " { }  ";
//        }
//        cout << "\n";
        return ;
    }else{
        for(int i = 0 ; i < 4 ; i ++)
        {
            int tx = x + dx[i];
            int ty = y + dy[i];
            if(tx >= 0 && ty >= 0 && tx < n && ty < m  && vis[tx][ty] == 0 && a[tx][ty] != -1 ){
                vis[tx][ty] = 1;
                cur.push_back({tx,ty});
                dfs(tx,ty,cur,a,vis);
                cur.pop_back();
                vis[tx][ty] = 0;
            }
        }
    }

}
void solve() {
    cin >> n >> m >>t >> sx >>sy >>ex >>ey;
    sx --,sy --,ex --,ey--;

    vector<vector<int>> a(n + 1,vector(m + 1,0)),vis(n + 1,vector(m + 1,0));
    vis[sx][sy] = 1;
    int x,y;
    while(t --)
    {
        cin >> x >> y;
        x --,y--;
        a[x][y] = -1;
        vis[x][y] = 1;
    }
    if(a[ex][ey] == -1) {cout << "0\n";return ;}
    vector<PII> cur={{sx,sy}};
    dfs(sx,sy,cur,a,vis);
    cout << ans <<"\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
//    cin >> T;
    while (T--) solve();
//    cout << "\n"[];
    return 0;
}